package cn.lzy.demo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Description
 * @Author lzy
 * @Date 2024/1/12 1:33
 * @Version
 **/
public class TestDemo02 {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(JavaConfig.class);

        // ======== 发布事件： =========
        ctx.addApplicationListener(new MyShopListener());
        Shop shop = new Shop(TestDemo02.class);
        shop.setName("一夜暴富");
        shop.setBoss("小黑");
        ctx.publishEvent(shop);
    }
}
